import axios from 'axios'

const subjects = {
    //获取专业
    getSubjects(pageSize, currentPage) {
        return axios({
            url: "/subjects/getSubjects",
            method: 'GET',
            params: {
                pageSize: pageSize,
                currentPage: currentPage
            }
        })
    },
    //新增专业
    addSubject(name) {
        return axios({
            url: "/subjects/addSubjects",
            method: 'POST',
            data: {
                name: name
            }
        })
    },
    //修改专业
    updateSubject(data) {
        return axios({
            url: '/subjects/updateSubjects',
            method: 'PUT',
            data
        })
    },
    //删除专业
    delSubject(id) {
        return axios({
            url: "/subjects/deleteSubjects",
            method: 'DELETE',
            data: {
                _id: id
            }
        })
    },
}

export default subjects;